import { Provide } from '@midwayjs/core';
import { CoolController, BaseController } from '@cool-midway/core';
import { ProjectMemberEntity } from '../../entity/member';
import { ProjectMemberService } from '../../service/member';

/**
 * 项目成员管理
 */
@Provide()
@CoolController({
    api: ['add', 'delete', 'update', 'info', 'list', 'page'],
    entity: ProjectMemberEntity,
    service: ProjectMemberService,
    pageQueryOp: {
        keyWordLikeFields: [],
        fieldEq: ['projectId', 'roleType'],
        select: ['a.*', 'b.name as userName', 'b.avatar as userAvatar'],
        join: [
            {
                entity: 'base_sys_user',
                alias: 'b',
                condition: 'a.userId = b.id',
                type: 'leftJoin'
            }
        ]
    }
})
export class ProjectMemberController extends BaseController {} 